#include "stdafx.h"
#include "WebCameraStreamSource.h"
#include "WebCameraStreamReceiver.h"

CWebCameraStreamSource::CWebCameraStreamSource(void)
{
	m_int_stream_input_type = STREAM_INPUT_WEBCAM;
}

CWebCameraStreamSource::~CWebCameraStreamSource(void)
{
	if (m_ptr_input_device)
	{
		if (m_ptr_input_device->self_info)
			delete (DEVICE_WEBCAMERA*)m_ptr_input_device->self_info;

		delete m_ptr_input_device;
		m_ptr_input_device = NULL;
	}
}

void CWebCameraStreamSource::StartStreamReceiver()
{
	m_bln_isStreamReceiving = TRUE;

	if (m_ptr_stream_receiver)
	{
		m_ptr_stream_receiver->Stop();
		delete m_ptr_stream_receiver;
	}

	m_ptr_stream_receiver = new CWebCameraStreamReceiver(m_int_stream_id);
	//m_ptr_stream_receiver->Start();
}
